import request from './request'

// 获取所有签到活动
export function getSignActivities() {
  return request({
    url: '/teacher/sign-activities',
    method: 'get'
  })
}

// 创建普通签到
export function createNormalSignActivity(data) {
  return request({
    url: '/teacher/sign-activities/normal',
    method: 'post',
    data
  })
}

// 创建签到码签到
export function createCodeSignActivity(data) {
  return request({
    url: '/teacher/sign-activities/code',
    method: 'post',
    data
  })
}

// 修改普通签到
export function updateSignActivity(id, data) {
  return request({
    url: `/teacher/sign-activities/${id}`,
    method: 'put',
    data
  })
}
// 创建九宫格签到
export const createGestureSignActivity = (data) => {
  return request({
    url: '/teacher/sign-activities/gesture',
    method: 'post',
    data
  })

}
// 创建位置签到
export const createLocationSignActivity = (data) => {
  return request({
    url: '/teacher/sign-activities/location',
    method: 'post',
    data
  })
}
// 删除签到活动
export function deleteSignActivity(id) {
  return request({
    url: `/teacher/sign-activities/${id}`,
    method: 'delete'
  })
}

// 获取签到统计信息
export function getSignStatistics() {
  return request({
    url: '/teacher/sign-activities/statistics',
    method: 'get'
  })
}

// 获取单个活动统计信息
export function getActivityStatistics(id) {
  return request({
    url: `/teacher/sign-activities/${id}/statistics`,
    method: 'get'
  })
}

// 创建二维码签到活动
export function createQRCodeSignActivity(data) {
  return request({
    url: '/teacher/sign-activities/qrcode',
    method: 'post',
    data
  })
}

// 获取签到活动二维码
export function getSignActivityQRCode(activityId) {
  return request({
    url: `/teacher/sign-activities/${activityId}/qrcode`,
    method: 'get'
  })
}